Skip to content

Comments

[18.0] migration leftover product_assortment#1908

Open
bosd wants to merge 8 commits intoOCA:18.0from
bosd:18.0-mig-product_assortment-temp
Open

[18.0] migration leftover product_assortment#1908
bosd wants to merge 8 commits intoOCA:18.0from
bosd:18.0-mig-product_assortment-temp

Conversation

@bosd
Copy link
Contributor

@bosd bosd commented Mar 6, 2025

Leftover migration from #1904

@bosd bosd force-pushed the 18.0-mig-product_assortment-temp branch 3 times, most recently from 20b5b39 to 011c5d7 Compare March 6, 2025 21:30
@bosd bosd changed the title [18.0] migration leftover product_assortmen [18.0] migration leftover product_assortment Mar 19, 2025
@bosd
Copy link
Contributor Author

bosd commented Mar 19, 2025

@carlosdauden Can you take a look here?

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Oct 19, 2025
@bosd bosd force-pushed the 18.0-mig-product_assortment-temp branch from 011c5d7 to 85cb9a7 Compare October 19, 2025 14:10
@pedrobaeza pedrobaeza removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Oct 20, 2025
@pedrobaeza pedrobaeza added this to the 18.0 milestone Oct 20, 2025
def _compute_all_partner_ids(self):
"""Summarize selected partners and partners from partner domain field"""
for ir_filter in self:
for ir_filter in self.sudo():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether we should use compte_sudo or add self.sudo?
IMO compute_sudo is better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"I’ve updated the field to use compute_sudo=True instead of adding .sudo() inside the loop. Since we are performing a search() on res.partner based on a dynamic domain, compute_sudo ensures the computation is consistent and avoids potential AccessErrors for non-admin users, while also being more performant for the Odoo cache."

"tuple(self._compute_domain_context_values())",
),
)
def _compute_domain(self, model_name, mode="read"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, the proper place will be the search method of ir.filters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! refactored it. moved this logic to the _search method of ir.filters instead. This keeps the restriction scoped to the model itself and avoids the overhead of the global rule engine

bosd and others added 2 commits January 24, 2026 12:41
@bosd bosd force-pushed the 18.0-mig-product_assortment-temp branch 3 times, most recently from 16624a6 to 8a0ebc7 Compare January 24, 2026 13:13
@bosd bosd force-pushed the 18.0-mig-product_assortment-temp branch from 8a0ebc7 to 9f799da Compare January 24, 2026 13:24
@bosd bosd requested a review from bizzappdev January 24, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants